package com.greenold.refunds.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.greenold.common.annotation.Excel;
import com.greenold.common.core.domain.BaseEntity;

/**
 * 退款记录对象 refund
 * 
 * @author ruoyi
 * @date 2025-10-14
 */
public class Refund extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private String id;

    /** 交易系统订单号（商户订单） */
    private String tradeOrderNo;

    /** 本次退款订单号 */
    @Excel(name = "本次退款订单号")
    private String refundOrderNo;

    /** 业务系统订单号 */
    @Excel(name = "业务系统订单号")
    private String bizOrderNo;

    /** 本次退款金额 */
    @Excel(name = "本次退款金额")
    private BigDecimal refundAmount;

    /** 申请人 */
    @Excel(name = "申请人")
    private String createdBy;

//    @Excel(name="申请人名字")
//    private String customerName;
    /** 申请时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 退款时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private String extend1;

    /** 退款状态（0 - 未知错误，1 - 退款中，2 - 成功，3 - 失败） */
    @Excel(name = "退款状态", readConverterExp = "0=.退款处理中,1=.退款成共,2=.退款失败")
    private String refundStatus;

    /** 退款原因 */
    private String extend2;
    /** 商户号 */
    private String merchantNo;

    /** 退款渠道【支付宝、微信、现金】 */
    private String refundChannel;

    /** 返回编码 */
    private String returnCode;

    /** 返回信息 */
    private String returnMsg;

    /** 备注（订单门店，桌台信息） */
    private String orderRemark;

    /** 原订单金额 */
    private BigDecimal originalAmount;

    /** $column.columnComment */
    private String updatedBy;

    /** 操作来源（1 前台，2 后台） */
    private String source;
    /** 关联订单ID（新增：用于关联订单表的id字段） */
    private String orderId;


//     public String getCustomerName() {
//        return customerName;
//    }
//    public void setCustomerName(String customerName) {
//        this.customerName = customerName;
//    }

    // ... 新增 get/set 方法 ...
    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }




    public void setId(String id) 
    {
        this.id = id;
    }

    public String getId() 
    {
        return id;
    }

    public void setTradeOrderNo(String tradeOrderNo) 
    {
        this.tradeOrderNo = tradeOrderNo;
    }

    public String getTradeOrderNo() 
    {
        return tradeOrderNo;
    }

    public void setRefundOrderNo(String refundOrderNo) 
    {
        this.refundOrderNo = refundOrderNo;
    }

    public String getRefundOrderNo() 
    {
        return refundOrderNo;
    }

    public void setBizOrderNo(String bizOrderNo) 
    {
        this.bizOrderNo = bizOrderNo;
    }

    public String getBizOrderNo() 
    {
        return bizOrderNo;
    }

    public void setRefundAmount(BigDecimal refundAmount) 
    {
        this.refundAmount = refundAmount;
    }

    public BigDecimal getRefundAmount() 
    {
        return refundAmount;
    }

    public void setCreatedBy(String createdBy) 
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() 
    {
        return createdBy;
    }

    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    public void setExtend1(String extend1) 
    {
        this.extend1 = extend1;
    }

    public String getExtend1() 
    {
        return extend1;
    }

    public void setRefundStatus(String refundStatus) 
    {
        this.refundStatus = refundStatus;
    }

    public String getRefundStatus() 
    {
        return refundStatus;
    }

    public void setMerchantNo(String merchantNo) 
    {
        this.merchantNo = merchantNo;
    }

    public String getMerchantNo() 
    {
        return merchantNo;
    }

    public void setRefundChannel(String refundChannel) 
    {
        this.refundChannel = refundChannel;
    }

    public String getRefundChannel() 
    {
        return refundChannel;
    }

    public void setReturnCode(String returnCode) 
    {
        this.returnCode = returnCode;
    }

    public String getReturnCode() 
    {
        return returnCode;
    }

    public void setReturnMsg(String returnMsg) 
    {
        this.returnMsg = returnMsg;
    }

    public String getReturnMsg() 
    {
        return returnMsg;
    }

    public void setOrderRemark(String orderRemark) 
    {
        this.orderRemark = orderRemark;
    }

    public String getOrderRemark() 
    {
        return orderRemark;
    }

    public void setOriginalAmount(BigDecimal originalAmount) 
    {
        this.originalAmount = originalAmount;
    }

    public BigDecimal getOriginalAmount() 
    {
        return originalAmount;
    }

    public void setUpdatedBy(String updatedBy) 
    {
        this.updatedBy = updatedBy;
    }

    public String getUpdatedBy() 
    {
        return updatedBy;
    }

    public void setSource(String source) 
    {
        this.source = source;
    }

    public String getSource() 
    {
        return source;
    }

    public void setExtend2(String extend2) 
    {
        this.extend2 = extend2;
    }

    public String getExtend2() 
    {
        return extend2;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
                .append("orderId", getOrderId()) // 新增：打印orderId
            .append("tradeOrderNo", getTradeOrderNo())
            .append("refundOrderNo", getRefundOrderNo())
            .append("bizOrderNo", getBizOrderNo())
            .append("refundAmount", getRefundAmount())
            .append("createdBy", getCreatedBy())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .append("extend1", getExtend1())
            .append("refundStatus", getRefundStatus())
            .append("merchantNo", getMerchantNo())
            .append("refundChannel", getRefundChannel())
            .append("returnCode", getReturnCode())
            .append("returnMsg", getReturnMsg())
            .append("orderRemark", getOrderRemark())
            .append("originalAmount", getOriginalAmount())
            .append("updatedBy", getUpdatedBy())
            .append("remark", getRemark())
            .append("source", getSource())
            .append("extend2", getExtend2())
            .toString();
    }
}
